package com.bing.jh.enums;

import lombok.Getter;

public enum TTfrDetailDayEnums {
    GATEWAY(1, "智能家庭网关"),
    LETTERBOX(2, "机顶盒"),
    FTTR(3, "FTTR"),
    ROUTER(4, "路由器"),
    ;


    @Getter
    private Integer code;

    @Getter
    private String type;

    TTfrDetailDayEnums(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    public static TTfrDetailDayEnums fromCode(Integer code) {
        for (TTfrDetailDayEnums groupStat : values()) {
            if (groupStat.code.equals(code)) {
                return groupStat;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return String.format("%s (%d)", type, code);
    }
}
